/*
 * CajaTexto.java
 *
 * Created on 18 de marzo de 2008, 16:15
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package widget;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author notebook
 */
public class CajaTexto extends JPanel{

    private int x0=0;

    private int y0=0;

    private int w0=200;

    private int h0=24;

    private JLabel jl;

    private JTextField jct;

    private int borde=2;

    private int wr=60;
    
    /** Creates a new instance of CajaTexto */
    public CajaTexto(String st, int x0, int y0) {
        setLayout(null);
        setBounds(x0,y0,w0,h0);
        jl=new JLabel(st);
        jct= new JTextField();
        jl.setBounds(borde,borde,wr,h0-2*borde);
        jct.setBounds(2*borde+wr,borde,w0-wr-borde*3,h0-2*borde);
        add(jl);
        add(jct);
    }
    public void set(Comparable c){
        jct.setText((String) c);
    }
    
    public String get(){
        return jct.getText();
    }
    
}
